# Contributor: Hugo Wang <w@mitnk.com>
# Maintainer: Hugo Wang <w@mitnk.com>
pkgname=cicada
pkgver=1.0.3
pkgrel=0
pkgdesc="A bash-like Unix shell"
url="https://github.com/mitnk/cicada"
arch="all"
license="MIT"
depends="ncurses-terminfo-base"
makedepends="sqlite-dev cargo cargo-auditable"
checkdepends="xz"
install="$pkgname.post-install $pkgname.pre-deinstall"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/mitnk/cicada/archive/v$pkgver.tar.gz
	unbundle-sqlite.patch
	"


prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen --release --bins
}

package() {
	install -Dm755 target/release/cicada -t "$pkgdir"/usr/bin
	install -Dm644 docs/*.md -t "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
c025f7c1816638791e9e2ca759ed1989ec5ea07b62f48246ca0c4c868aa364f8847cc73073cb7675f61c387192f0417262d83c909ffd500eebae2420af96884a cicada-1.0.3.tar.gz
1a6a9eeb4477b6d434760c1c1cda97423f71957306d8ae3e0e0dc5fd32baf4e106c95b51adedef20aa995e96f0070430bf58ee51b59143985c32c80748041986  unbundle-sqlite.patch
"
